package asteroids.model.programs.expression;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.NoSuchElementException;

import asteroids.model.programs.type.*;

public class VariableExpression extends E {
	
	private String name;
	private T value;
	
	public VariableExpression(int line, int column, String name) {
		super(line, column);
		this.name = name;
	}

	@Override
	public T getValue() {
		return value;
	}
	
	public void setValue(T type){
		value = type;
	}
	
	public String getName(){
		return name;
	}

	@Override
	public void print() {
		System.out.println(name);
	}
	
	@Override
	public boolean isVariable(){
		return true;
	}
	
	@Override
	public ArrayList<VariableExpression> getVariables(){
		ArrayList<VariableExpression> list = new ArrayList<VariableExpression>();
		list.add(this);
		return list;
	}
	
	public String typecheck() {
		return "";
	}
}
